<!--
*  2021-03-15
*  成品跟踪  预计明细汇总
-->
<template>
  <div id="app" class="except-detail">
    <!-- 头部导航 -->
    <van-nav-bar
      ref="header"
      :title="title"
      left-arrow
      @click-left="onClickLeft"
      left-text="返回"
    >
    </van-nav-bar>
    <!-- 滚动 -->
    <better-scroll
      class="public-scroll"
      :data="tableData"
      :totalPage="totalPage"
    >
      <van-cell-group v-show="tableData.length !== 0">
        <van-cell
          v-for="(data, index) in tableData"
          :key="index"
          :title="data.stepName + '(' + data.stepNo + ')'"
          :value="data.num"
          :label="data.greyClothNos"
        >
        </van-cell>
      </van-cell-group>
      <van-empty
        class="custom-image"
        image="https://img01.yzcdn.cn/vant/custom-empty-image.png"
        v-show="tableData.length === 0"
        description="暂无数据"
      />
    </better-scroll>
  </div>
</template>

<script>
import { comeBack } from "@/utils/index";

export default {
  name: "productViewExceptDetail",
  data() {
    return {
      title: "",
      totalPage: 1,
      tableData: [],
      designNo: "",
      color: "",
      isColor: false,
      keyLike: "",
    };
  },
  mounted() {
    const that = this;
    if (process.env.NODE_ENV === "production") {
      this.$nextTick(() => {
        that.initFn(that);
      });
    } else {
      window.apiready = function () {
        that.initFn(that);
      };
    }
  },
  methods: {
    //初始化
    initFn(that) {
      that.tableData = window.api.pageParam.exceptDetails;
      that.title = window.api.pageParam.title;
      window.api.addEventListener({
        name:'viewdisappear'
      }, function() {
        window.api.closeWin();
      });
    },
    // 返回
    onClickLeft() {
      comeBack();
    },
  },
};
</script>

<style lang="scss">
.except-detail {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  .van-search {
    width: 100%;
    position: relative;
    z-index: 999;
  }
  .van-cell {
    width: 100%;
    display: flex;
    .van-cell__title {
      flex: 0 0 70% !important;
      overflow: hidden;
      .van-cell__label {
        width: 100%;
        word-wrap: break-word;word-break: normal;
      }
    }
  }
  
  .public-scroll {
    flex: 1;
    overflow: hidden;
  }
}
</style>
